/*   * TODO put header   */package com.byq.mm.smartlib.obd.commands;

/** * Abstract class for percentage commands. */
public abstract class PercentageObdCommand extends AbstractObdCommand {
	/** * @param command */
	public PercentageObdCommand(String command) {
		super(command);
	}

	/** * @param other */
	public PercentageObdCommand(AbstractObdCommand other) {
		super(other);
	}

	/** * */
	@Override
	public String getFormattedResult() {
		String res = getResult();
		if (!"NODATA".equals(res)) {
			float tempValue = (buffer.get(2) * 100.0f) / 255.0f;
			res = String.format("%.1f%s", tempValue, "%");
		}
		return res;
	}
}